import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
const About = () => import('@views/About/About.vue')
const Blog = () => import('@views/Blog/Blog.vue')
const BlogDetail = () => import('@views/Blog/BlogDetail.vue')
const notFound = () => import('@views/404/404.vue')
const WelfareCenter = () => import('@views/welfareCenter/welfareCenter.vue')
const Contact = () => import('@views/Contact/Contact.vue')
const SearchList = () => import('@views/SearchList/SearchList.vue')
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'index',
    component: About
  },
  {
    path: '/about',
    redirect: '/'
  },
  {
    path: '/index',
    redirect: '/'
  },
  {
    path: '/blog',
    name: 'Blog',
    component: Blog
  },
  {
    path: '/blogDetail',
    name: 'BlogDetail',
    component: BlogDetail
  },
  {
    path: '/welfareCenter',
    name: 'WelfareCenter',
    component: WelfareCenter
  },
  {
    path: '/contact',
    name: 'Contact',
    component: Contact
  },
  {
    path: '/searchList',
    name: 'SearchList',
    component: SearchList
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: notFound
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes,
  scrollBehavior: () => ({ left: 0, top: 0 })
})

export default router
